// $ANTLR 3.4 C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g 2012-10-24 11:28:01

package PL.prac6;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class ANTLRParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "APARENTESIS", "ASTERISCO", "BARRAS", "BLANCO", "CADENA", "COMILLAS", "CPARENTESIS", "DIGITO", "DOSPUNTOS", "ENDOFFILE", "ESPACIO", "IDENT", "LETRA", "LINEA_COMENTARIO", "MAS", "NUEVA_LINEA", "OR", "SEPARADOR"
    };

    public static final int EOF=-1;
    public static final int APARENTESIS=4;
    public static final int ASTERISCO=5;
    public static final int BARRAS=6;
    public static final int BLANCO=7;
    public static final int CADENA=8;
    public static final int COMILLAS=9;
    public static final int CPARENTESIS=10;
    public static final int DIGITO=11;
    public static final int DOSPUNTOS=12;
    public static final int ENDOFFILE=13;
    public static final int ESPACIO=14;
    public static final int IDENT=15;
    public static final int LETRA=16;
    public static final int LINEA_COMENTARIO=17;
    public static final int MAS=18;
    public static final int NUEVA_LINEA=19;
    public static final int OR=20;
    public static final int SEPARADOR=21;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public ANTLRParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public ANTLRParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return ANTLRParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g"; }



    // $ANTLR start "entrada"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:16:1: entrada : ( instruccion )+ EOF ;
    public final void entrada() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:16:8: ( ( instruccion )+ EOF )
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:16:10: ( instruccion )+ EOF
            {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:16:10: ( instruccion )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==IDENT) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:16:10: instruccion
            	    {
            	    pushFollow(FOLLOW_instruccion_in_entrada47);
            	    instruccion();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            match(input,EOF,FOLLOW_EOF_in_entrada50); 

            }

        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "entrada"



    // $ANTLR start "instruccion"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:17:1: instruccion : IDENT DOSPUNTOS regla ( ENDOFFILE )? SEPARADOR ;
    public final void instruccion() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:17:12: ( IDENT DOSPUNTOS regla ( ENDOFFILE )? SEPARADOR )
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:17:14: IDENT DOSPUNTOS regla ( ENDOFFILE )? SEPARADOR
            {
            match(input,IDENT,FOLLOW_IDENT_in_instruccion56); 

            match(input,DOSPUNTOS,FOLLOW_DOSPUNTOS_in_instruccion58); 

            pushFollow(FOLLOW_regla_in_instruccion60);
            regla();

            state._fsp--;


            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:17:36: ( ENDOFFILE )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==ENDOFFILE) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:17:36: ENDOFFILE
                    {
                    match(input,ENDOFFILE,FOLLOW_ENDOFFILE_in_instruccion62); 

                    }
                    break;

            }


            match(input,SEPARADOR,FOLLOW_SEPARADOR_in_instruccion65); 

            }

        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "instruccion"



    // $ANTLR start "regla"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:1: regla : regla1 ( OR )? ( regla2 )* ;
    public final void regla() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:6: ( regla1 ( OR )? ( regla2 )* )
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:9: regla1 ( OR )? ( regla2 )*
            {
            pushFollow(FOLLOW_regla1_in_regla72);
            regla1();

            state._fsp--;


            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:16: ( OR )?
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==OR) ) {
                alt3=1;
            }
            switch (alt3) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:16: OR
                    {
                    match(input,OR,FOLLOW_OR_in_regla74); 

                    }
                    break;

            }


            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:20: ( regla2 )*
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( (LA4_0==APARENTESIS) ) {
                    alt4=1;
                }


                switch (alt4) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:18:20: regla2
            	    {
            	    pushFollow(FOLLOW_regla2_in_regla77);
            	    regla2();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop4;
                }
            } while (true);


            }

        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "regla"



    // $ANTLR start "regla1"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:1: regla1 : ( sentencia ( MAS | ASTERISCO )? )* ( OR ( sentencia )+ )* ;
    public final void regla1() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:7: ( ( sentencia ( MAS | ASTERISCO )? )* ( OR ( sentencia )+ )* )
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:9: ( sentencia ( MAS | ASTERISCO )? )* ( OR ( sentencia )+ )*
            {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:9: ( sentencia ( MAS | ASTERISCO )? )*
            loop6:
            do {
                int alt6=2;
                int LA6_0 = input.LA(1);

                if ( (LA6_0==CADENA||LA6_0==IDENT) ) {
                    alt6=1;
                }


                switch (alt6) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:10: sentencia ( MAS | ASTERISCO )?
            	    {
            	    pushFollow(FOLLOW_sentencia_in_regla185);
            	    sentencia();

            	    state._fsp--;


            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:20: ( MAS | ASTERISCO )?
            	    int alt5=2;
            	    int LA5_0 = input.LA(1);

            	    if ( (LA5_0==ASTERISCO||LA5_0==MAS) ) {
            	        alt5=1;
            	    }
            	    switch (alt5) {
            	        case 1 :
            	            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:
            	            {
            	            if ( input.LA(1)==ASTERISCO||input.LA(1)==MAS ) {
            	                input.consume();
            	                state.errorRecovery=false;
            	            }
            	            else {
            	                MismatchedSetException mse = new MismatchedSetException(null,input);
            	                throw mse;
            	            }


            	            }
            	            break;

            	    }


            	    }
            	    break;

            	default :
            	    break loop6;
                }
            } while (true);


            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:39: ( OR ( sentencia )+ )*
            loop8:
            do {
                int alt8=2;
                int LA8_0 = input.LA(1);

                if ( (LA8_0==OR) ) {
                    int LA8_1 = input.LA(2);

                    if ( (LA8_1==CADENA||LA8_1==IDENT) ) {
                        alt8=1;
                    }


                }


                switch (alt8) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:40: OR ( sentencia )+
            	    {
            	    match(input,OR,FOLLOW_OR_in_regla197); 

            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:43: ( sentencia )+
            	    int cnt7=0;
            	    loop7:
            	    do {
            	        int alt7=2;
            	        int LA7_0 = input.LA(1);

            	        if ( (LA7_0==CADENA||LA7_0==IDENT) ) {
            	            alt7=1;
            	        }


            	        switch (alt7) {
            	    	case 1 :
            	    	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:19:43: sentencia
            	    	    {
            	    	    pushFollow(FOLLOW_sentencia_in_regla199);
            	    	    sentencia();

            	    	    state._fsp--;


            	    	    }
            	    	    break;

            	    	default :
            	    	    if ( cnt7 >= 1 ) break loop7;
            	                EarlyExitException eee =
            	                    new EarlyExitException(7, input);
            	                throw eee;
            	        }
            	        cnt7++;
            	    } while (true);


            	    }
            	    break;

            	default :
            	    break loop8;
                }
            } while (true);


            }

        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "regla1"



    // $ANTLR start "regla2"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:20:1: regla2 : APARENTESIS ( regla3 )+ CPARENTESIS ( MAS | ASTERISCO )? ;
    public final void regla2() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:20:7: ( APARENTESIS ( regla3 )+ CPARENTESIS ( MAS | ASTERISCO )? )
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:20:9: APARENTESIS ( regla3 )+ CPARENTESIS ( MAS | ASTERISCO )?
            {
            match(input,APARENTESIS,FOLLOW_APARENTESIS_in_regla2108); 

            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:20:21: ( regla3 )+
            int cnt9=0;
            loop9:
            do {
                int alt9=2;
                int LA9_0 = input.LA(1);

                if ( (LA9_0==APARENTESIS||LA9_0==CADENA||LA9_0==IDENT) ) {
                    alt9=1;
                }


                switch (alt9) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:20:21: regla3
            	    {
            	    pushFollow(FOLLOW_regla3_in_regla2110);
            	    regla3();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    if ( cnt9 >= 1 ) break loop9;
                        EarlyExitException eee =
                            new EarlyExitException(9, input);
                        throw eee;
                }
                cnt9++;
            } while (true);


            match(input,CPARENTESIS,FOLLOW_CPARENTESIS_in_regla2113); 

            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:20:41: ( MAS | ASTERISCO )?
            int alt10=2;
            int LA10_0 = input.LA(1);

            if ( (LA10_0==ASTERISCO||LA10_0==MAS) ) {
                alt10=1;
            }
            switch (alt10) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:
                    {
                    if ( input.LA(1)==ASTERISCO||input.LA(1)==MAS ) {
                        input.consume();
                        state.errorRecovery=false;
                    }
                    else {
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    }
                    break;

            }


            }

        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "regla2"



    // $ANTLR start "regla3"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:1: regla3 : ( ( sentencia ( OR sentencia )* ) | regla2 );
    public final void regla3() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:7: ( ( sentencia ( OR sentencia )* ) | regla2 )
            int alt12=2;
            int LA12_0 = input.LA(1);

            if ( (LA12_0==CADENA||LA12_0==IDENT) ) {
                alt12=1;
            }
            else if ( (LA12_0==APARENTESIS) ) {
                alt12=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 12, 0, input);

                throw nvae;

            }
            switch (alt12) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:9: ( sentencia ( OR sentencia )* )
                    {
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:9: ( sentencia ( OR sentencia )* )
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:10: sentencia ( OR sentencia )*
                    {
                    pushFollow(FOLLOW_sentencia_in_regla3127);
                    sentencia();

                    state._fsp--;


                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:20: ( OR sentencia )*
                    loop11:
                    do {
                        int alt11=2;
                        int LA11_0 = input.LA(1);

                        if ( (LA11_0==OR) ) {
                            alt11=1;
                        }


                        switch (alt11) {
                    	case 1 :
                    	    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:21: OR sentencia
                    	    {
                    	    match(input,OR,FOLLOW_OR_in_regla3130); 

                    	    pushFollow(FOLLOW_sentencia_in_regla3132);
                    	    sentencia();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop11;
                        }
                    } while (true);


                    }


                    }
                    break;
                case 2 :
                    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:21:37: regla2
                    {
                    pushFollow(FOLLOW_regla2_in_regla3137);
                    regla2();

                    state._fsp--;


                    }
                    break;

            }
        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "regla3"



    // $ANTLR start "sentencia"
    // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:22:1: sentencia : ( IDENT | CADENA );
    public final void sentencia() throws RecognitionException {
        try {
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:22:10: ( IDENT | CADENA )
            // C:\\Users\\Jose\\workspace\\prac6\\src\\main\\java\\PL\\prac6\\ANTLRParser.g:
            {
            if ( input.LA(1)==CADENA||input.LA(1)==IDENT ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

        }
        catch (RecognitionException e) {
          throw e;}
         
        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "sentencia"

    // Delegated rules


 

    public static final BitSet FOLLOW_instruccion_in_entrada47 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_EOF_in_entrada50 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_instruccion56 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_DOSPUNTOS_in_instruccion58 = new BitSet(new long[]{0x0000000000108110L});
    public static final BitSet FOLLOW_regla_in_instruccion60 = new BitSet(new long[]{0x0000000000202000L});
    public static final BitSet FOLLOW_ENDOFFILE_in_instruccion62 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_SEPARADOR_in_instruccion65 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_regla1_in_regla72 = new BitSet(new long[]{0x0000000000100012L});
    public static final BitSet FOLLOW_OR_in_regla74 = new BitSet(new long[]{0x0000000000000012L});
    public static final BitSet FOLLOW_regla2_in_regla77 = new BitSet(new long[]{0x0000000000000012L});
    public static final BitSet FOLLOW_sentencia_in_regla185 = new BitSet(new long[]{0x0000000000148122L});
    public static final BitSet FOLLOW_OR_in_regla197 = new BitSet(new long[]{0x0000000000008100L});
    public static final BitSet FOLLOW_sentencia_in_regla199 = new BitSet(new long[]{0x0000000000108102L});
    public static final BitSet FOLLOW_APARENTESIS_in_regla2108 = new BitSet(new long[]{0x0000000000008110L});
    public static final BitSet FOLLOW_regla3_in_regla2110 = new BitSet(new long[]{0x0000000000008510L});
    public static final BitSet FOLLOW_CPARENTESIS_in_regla2113 = new BitSet(new long[]{0x0000000000040022L});
    public static final BitSet FOLLOW_sentencia_in_regla3127 = new BitSet(new long[]{0x0000000000100002L});
    public static final BitSet FOLLOW_OR_in_regla3130 = new BitSet(new long[]{0x0000000000008100L});
    public static final BitSet FOLLOW_sentencia_in_regla3132 = new BitSet(new long[]{0x0000000000100002L});
    public static final BitSet FOLLOW_regla2_in_regla3137 = new BitSet(new long[]{0x0000000000000002L});

}